package com.javaGather.demo3;

import java.util.ArrayList;
import java.util.HashMap;

public class Test1 {
    public static void main(String[] args) {

//        ArrayList<HashMap<String, String>> objects = new ArrayList<>();
//        HashMap<String, String> hashMap1 = new HashMap<>();
//        hashMap1.put("key1", "value1");
//        HashMap<String, String> hashMap2 = new HashMap<>();
//        hashMap2.put("key2", "value2");
//        HashMap<String, String> hashMap3 = new HashMap<>();
//        hashMap3.put("key3", "value3");
//
//        objects.add(hashMap1);
//        objects.add(hashMap2);
//        objects.add(hashMap3);
//
//        for (HashMap<String, String> hashMap : objects) {
//            System.out.println(hashMap);
//        }

        /**
         * key:省份
         * value：省份下城市
         */
        HashMap<String, ArrayList<String>> hashMap = new HashMap<>();
        ArrayList<String> hubei = new ArrayList<>();
        hubei.add("武汉");
        hubei.add("随州");
        hubei.add("襄阳");

        ArrayList<String> gansu = new ArrayList<>();
        gansu.add("兰州");
        gansu.add("酒泉");

        hashMap.put("湖北省", hubei);
        hashMap.put("甘肃省", gansu);

        for (String key : hashMap.keySet()) {
            System.out.println("省份:" + key);
            System.out.print("城市：");
            System.out.println(hashMap.get(key));

        }


    }
}
